![]() |
KCAddInternetPassword |
||||
Header: | Keychain.h | Carbon status: | Under Evaluation | |
Adds a new Internet server password to the default keychain.
OSStatus KCAddInternetPassword ( StringPtr serverName, StringPtr securityDomain, StringPtr accountName, UInt16 port, OSType protocol, OSType authType, UInt32 passwordLength, const void *passwordData, KCItemRef *item );
A pointer to a Pascal string containing the server name.
A pointer to a Pascal string containing the security domain. This parameter is optional, as not all protocols will require it.
A pointer to a Pascal string containing the account name.
The TCP/IP port number. Pass the constant kAnyPort, described in “Default Port Constant”, to specify any port.
The protocol associated with this password. See
The authentication scheme used. See
The length of the buffer pointed to by passwordData.
A pointer to a buffer which will hold the returned password data. Before calling KCAddInternetPasswordWithPath, allocate enough memory for the buffer to hold the data you want to store.
On return, a pointer to a reference to the added item. Pass NULL if you don’t want to obtain this reference.
A result code. The result code errKCNoDefaultKeychain indicates that no default keychain could be found. The result code errKCDuplicateItem indicates that you tried to add a password that already exists in the keychain. The result code errKCDataTooLarge indicates that you tried to add more data than is allowed for a record of this type.
The KCAddInternetPassword function adds a new Internet server password to the default keychain. Required parameters to identify the password are serviceName and accountName (you cannot pass NULL for both parameters). In addition, some protocols may require an optional securityDomain when authentication is requested. KCAddInternetPassword optionally returns a reference to the newly added item.
Available beginning with Keychain Manager 1.0. In Keychain Manager 1.0, the kcaddinternetpassword function provides the same functionality as KCAddInternetPassword, except that it accepts C strings rather than Pascal strings as arguments. In Keychain 2.0, you should use KCAddInternetPassword, since kcaddinternetpassword is provided for convenience only and may be removed from the header file at some point in the future.
Under evaluation for Carbon. Available in CarbonLib 1.0 and later when KeychainLib 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by KeychainLib 1.0 and later.
© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)